package com.ems.controller;

import com.ems.config.LogPointer;
import com.ems.service.IAlarmService;
import com.ems.util.ConstUtil;
import com.ems.vo.AlarmVo;
import com.ems.vo.BaseResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 报警/故障 前端控制器
 * </p>
 *
 * @author WuZH
 * @since 2023-10-24
 */
@RestController
@RequestMapping ( "/alarm" )
@CrossOrigin ( value = "*", maxAge = 3600 )
public class AlarmController {

    @Resource
    private IAlarmService iAlarmService;

    @RequestMapping ( "queryList" )
    @LogPointer ( "警告列表" )
    public BaseResult queryList ( @RequestBody AlarmVo alarmVo ) {
        List<AlarmVo> alarmEntities = iAlarmService.queryList ( alarmVo );
        return BaseResult.success ( alarmEntities, iAlarmService.queryCount ( alarmVo ) );
    }


}
